package io.github.wanggit.antrpc.demo.config_center.demo2;

import io.github.wanggit.antrpc.client.config.IConfigClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("demo")
public class DemoController {

    @Autowired
    private IConfigClient configClient;

    @GetMapping("cnf_value")
    public String getConfigValue(@RequestParam("name") String name){
        return configClient.getValue(name, "Not Found!!!");
    }

}
